cmake_minimum_required(VERSION 3.20)
project(prime)

set(CMAKE_CXX_STANDARD 17)

add_library(rng STATIC prime-rng.cpp prime-rng.hpp)

add_library(next STATIC prime-next.cpp prime-next.hpp)

# main is only aware of the declaration
add_executable(prime main.cpp prime-rng.hpp prime-next.hpp)

# we link the two libraries
target_link_libraries(prime PRIVATE rng next)
